package com.qf.generator.Utils;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyExceptionHandler {
    @ExceptionHandler // 捕获任意异常
    public R handleException(Exception e){
        R r = new R();
        r.setCode(500);
        r.setMsg("系统错误,请联系管理员,"+e.getMessage());
        return r;
    }
}

